<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>友情链接</title>
  <link rel="stylesheet" href="/admin/assets/lib/layui/css/layui.css">
  <link rel="stylesheet" href="./css/link.css">
</head>
<body>

</div>
  <div class="layui-card">
    <div class="layui-card-header header">
      友情链接
      <button type="button" class="layui-btn layui-btn-normal addBtn">添加链接</button>
    </div>
    <div class="layui-card-body">
      <table class="layui-table">
        <colgroup>
          <col width="80">
          <col width="200">
          <col width="200">
          <col width="300">
          <col>
          <col>
        </colgroup>
        <thead>
          <tr>
            <th>ID</th>
            <th>链接图标</th>
            <th>链接名称</th>
            <th>链接地址</th>
            <th>链接描述</th>
            <th>操作</th>
          </tr>
        </thead>
        <tbody id="tb">
          <!-- <tr>
            <td>贤心</td>
            <td>2016-11-29</td>
            <td>人生就像是一场修行</td>
            <td>人生就像是一场修行</td>
            <td>人生就像是一场修行</td>
          </tr> -->
        </tbody>
      </table>
    </div>
  </div>

  <!-- 创建template模板 -->
  <script type="text/html" id="template">
  {{each data v i}}
  <tr>
    <td>{{v.id}}</td>
    <td class="icon-wrap"><img src="{{'http://localhost:8888/uploads/' + v.linkicon}}"></td>
    <td>{{v.linkname}}</td>
    <td>{{v.linkurl}}</td>
    <td>{{v.linkdesc}}</td>
    <td>
      <button type="button" class="layui-btn layui-btn-xs editBtn" data-id="{{v.id}}">编辑</button>
      <button type="button" class="layui-btn layui-btn-danger layui-btn-xs delBtn" data-id="{{v.id}}">删除</button>
    </td>
  </tr>
  {{/each}}
</script>
<!-- id: 1
linkdesc: "阿里云"
linkicon: "aliyun.png"
linkname: "阿里云"
linkstatus: 1
linkurl: "https://www.aliyun.com/" -->

<!-- 创建弹出层面板 -->
<script type="text/html" id="linkTemp">
  <form class="layui-form" id="addLink" lay-filter="friendLink">
      <div class="layui-form-item">
        <label class="layui-form-label">链接名称</label>
        <div class="layui-input-block">
          <input type="text" name="linkname" required  lay-verify="required" placeholder="请输入链接名称" autocomplete="off" class="layui-input">
        </div>
      </div>
      <div class="layui-form-item">
        <label class="layui-form-label">链接地址</label>
        <div class="layui-input-block">
          <input type="text" name="linkurl" required  lay-verify="required" placeholder="请输入链接地址" autocomplete="off" class="layui-input">
        </div>
      </div>
      <div class="layui-form-item">
        <label class="layui-form-label">链接描述</label>
        <div class="layui-input-block">
          <input type="text" name="linkdesc" required  lay-verify="required" placeholder="请输入链接描述" autocomplete="off" class="layui-input">
        </div>
      </div>
      <div class="layui-form-item">
        <div class="layui-input-block">
          <input type="file" accept="image/*" id="upload" style="display: none;">
          <button type="button" class="layui-btn layui-btn-sm udpBtn"><i class="layui-icon layui-icon-upload-circle"> </i> 上传图片</button><img src="" alt="" id="imgWrap" style="display: none;">
        </div>
      </div>
      <div class="layui-form-item">
        <div class="layui-input-block">
          <button class="layui-btn" lay-submit lay-filter="formDemo">提交</button>
          <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
      </div>
    </form>
</script>


  <!-- 导入相关js文件 -->
  <script src="/admin/assets/lib/jquery.js"></script>
  <script src="/admin/assets/js/common.js"></script>
  <script src="/admin/assets/lib/layui/layui.all.js"></script>
  <script src="/admin/assets/lib/template-web.js"></script>

  <!-- 导入自己的主页js文件 -->
  <script src="/admin/assets/js/source/link.js"></script>
</body>
</html>